package HomeWork;

public class Test05 {
    public static void main(String[] args) {
        Book1 a=new Book1("1","a",10);
        Book2 b=new Book2("2","b",100);
        Book3 c=new Book3("3","c",1000);
        if(a.price<b.price && b.price<c.price){
            System.out.print("最贵的书是：");
            c.show();
        }else if(a.price<b.price && a.price>c.price){
            System.out.print("最贵的书是：");
            b.show();
        }else{
            System.out.print("最贵的书是：");
            a.show();
        }
    }
}
class Book1{
    public String id;
    public String name;
    public int price;

    public Book1() {
    }

    public Book1(String id, String name, int price) {
        this.id = id;
        this.name = name;
        this.price = price;
    }
    public void show(){
        System.out.println("编号为"+id+"名称为"+name+"价格为"+price);
    }
}
class Book2 extends Book1{
    public Book2(String id, String name, int price) {
        super(id, name, price);
    }

    public Book2() {
    }
}
class Book3 extends Book1{
    public Book3(String id, String name, int price) {
        super(id, name, price);
    }

    public Book3() {
    }
}